package com.han.gift.clients;

import com.han.gift.common.util.AjaxResult;
import com.han.gift.entity.LoginUser;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author:Han
 * @Date :2023/2/26 18:51
 * @Description:
 */
@Component
public class LoginUserClientFallbackFactory implements FallbackFactory<LoginUserClient> {

    @Override
    public LoginUserClient create(Throwable throwable) {
       return new LoginUserClient() {
           @Override
           public AjaxResult addOrUpdate(LoginUser loginUser) {
               return AjaxResult.me().setSuccess(false).setMessage("服务繁忙!请稍后重试");
           }
       };
    }
}
